using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Threading;
public partial class _Default : System.Web.UI.Page 
{
    private void ChangeText(string culture)
    {
        Session["culture"] = culture;
        Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(culture);
        Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(culture);
        lblName.Text = GetLocalResourceObject("lbl").ToString();
        btnHello.Text = GetLocalResourceObject("btn").ToString();
    }

    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void LinkButton1_Click(object sender, EventArgs e)
    {

    }
    protected void LinkButton2_Click(object sender, EventArgs e)
    {

    }
    protected void lbtnEnglish_Click(object sender, EventArgs e)
    {
        //ChangeText("en-US");
        Response.Redirect("Default.aspx?culture=en-US");
    }
    protected void lbtnVietnames_Click(object sender, EventArgs e)
    {
        //ChangeText("vi-VN");
        Response.Redirect("Default.aspx?culture=vi-VN");
    }

    protected override void InitializeCulture()
    {
        //base.InitializeCulture();
        string culture = Request.QueryString["culture"];
        if (culture != null)
        {
            Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(culture);
            Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(culture);
        }
        else
        {
            Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("vi-VN");
            Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("vi-VN");
        }
    }
}
